package com.ruoyi.mall.service;

import com.ruoyi.mall.domain.MallOrderDetail;
import com.ruoyi.mall.mapper.MallOrderDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单详情Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-11
 */
@Service
public class MallOrderDetailService {
    @Autowired
    private MallOrderDetailMapper mallOrderDetailMapper;

    /**
     * 查询订单详情
     *
     * @param orderDetailId 订单详情主键
     * @return 订单详情
     */
    public MallOrderDetail selectMallOrderDetailByOrderDetailId(Long orderDetailId) {
        return mallOrderDetailMapper.selectMallOrderDetailByOrderDetailId(orderDetailId);
    }

    /**
     * 查询订单详情列表
     *
     * @param mallOrderDetail 订单详情
     * @return 订单详情
     */
    public List<MallOrderDetail> selectMallOrderDetailList(MallOrderDetail mallOrderDetail) {
        return mallOrderDetailMapper.selectMallOrderDetailList(mallOrderDetail);
    }

    /**
     * 新增订单详情
     *
     * @param mallOrderDetail 订单详情
     * @return 结果
     */
    public int insertMallOrderDetail(MallOrderDetail mallOrderDetail) {
        return mallOrderDetailMapper.insertMallOrderDetail(mallOrderDetail);
    }

    /**
     * 修改订单详情
     *
     * @param mallOrderDetail 订单详情
     * @return 结果
     */
    public int updateMallOrderDetail(MallOrderDetail mallOrderDetail) {
        return mallOrderDetailMapper.updateMallOrderDetail(mallOrderDetail);
    }

    /**
     * 批量删除订单详情
     *
     * @param orderDetailIds 需要删除的订单详情主键
     * @return 结果
     */
    public int deleteMallOrderDetailByOrderDetailIds(Long[] orderDetailIds) {
        return mallOrderDetailMapper.deleteMallOrderDetailByOrderDetailIds(orderDetailIds);
    }

    /**
     * 删除订单详情信息
     *
     * @param orderDetailId 订单详情主键
     * @return 结果
     */
    public int deleteMallOrderDetailByOrderDetailId(Long orderDetailId) {
        return mallOrderDetailMapper.deleteMallOrderDetailByOrderDetailId(orderDetailId);
    }
}
